import "./index.css"
import { Button } from 'antd';
import { message } from "antd";
import { useEffect, useContext } from "react";
import ButtonTest from "../ButtonTest/index"
export default function Card({ name }) {
  const provider = useContext(name)
  useEffect(() => {
    console.log('执行了哈哈哈', name);
    success(123)
  })
  const success = (val, e) => {
    // console.log(val, e, 99);
    console.log(provider, '注入的');

    // message.open({
    //   type: 'success',
    //   content: val += 1,
    // });
  }
  return <div className="card">
    <h2>头部标题 </h2>
    <p>内容啊</p>
    <div>我是从MyContext中获取的:{provider}</div>
    <div className="test"> 我是测试的 因为字体不能用,需要转换</div>
    <div className="test1"> 我是测试的 因为字体不能用,需要转换</div>
    <Button type="primary" onClick={(e) => success(122, e)}>Button</Button>
    <ButtonTest></ButtonTest>
  </div>
}
